package com.lz.util.db;

import java.util.HashMap;
import java.util.Map;

public final class SQLConfig {

    private SQLConfig(){
    
        qryMap=new HashMap(5);
  
        qryMap.put("GETNEXT_ID",SQLConfig.GETNEXT_ID);
        qryMap.put("UPDATENEXT_ID",SQLConfig.UPDATENEXT_ID);
        
        
        
    }
    
    private static SQLConfig sqlConfig=new SQLConfig();
	private Map qryMap;
	
	//These are SQLs used to query/create/update/delete
	private static final String GETUSER="select * from users where id=? AND password=? AND status=1";
  	private static final String GETNEXT_ID="select id from sequence where type=?";
	private static final String UPDATENEXT_ID="update sequence set id=id+1 where type=?";
	private static final String RESET_ID="update sequence set id=1 where type=?";
       
    private Map getQueryMap(){return qryMap;}
    
    public static String getQuery(String key){
        return (String)sqlConfig.getQueryMap().get(key);
    }
    
}
